package cn.test;
//饿汉式单例模式
public class HungrySingleton {
    private static HungrySingleton instance=new HungrySingleton();
    private HungrySingleton(){

    }
    //A,B
    public static HungrySingleton getInstance(){
        return instance;
    }
    public void show(){
        System.out.println("单例模式show");
    }
}
